//
//  GMFindVC.m
//  StockSystem
//
//  Created by 小熊 on 2018/5/23.
//  Copyright © 2018年 小熊. All rights reserved.
//

#import "GMFindVC.h"
#import "GMNewsViewCell.h"

@interface GMFindVC ()<UITableViewDataSource,UITableViewDelegate,SDCycleScrollViewDelegate>
@property (nonatomic, strong) UITableView *tabView;
@property (nonatomic, strong) NSMutableArray *dataSource;
@property (nonatomic, strong) SDCycleScrollView *banarView;
@end

@implementation GMFindVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"新闻资讯";
    [self.tabView registerNib:[UINib nibWithNibName:@"GMNewsViewCell" bundle:nil] forCellReuseIdentifier:@"GMNewsViewCell"];
    self.tabView.tableHeaderView = self.banarView;

}
- (SDCycleScrollView *)banarView{
    if (!_banarView) {
        _banarView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, DEVICE_WIDTH, 180) delegate:self placeholderImage:DefealtImg];
        _banarView.bannerImageViewContentMode = UIViewContentModeScaleToFill;
        _banarView.localizationImageNamesGroup = @[@"guide_01",@"guide_02",@"guide_03",@"guide_04"];
        _banarView.titlesGroup =@[@"标题1",@"标题2",@"标题3",@"标题4"];
        _banarView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight;
        _banarView.autoScrollTimeInterval = 5;
    }
    return _banarView;
}
- (NSMutableArray *)dataSource{
    if (!_dataSource) {
        _dataSource =[[NSMutableArray alloc]init];
    }
    return _dataSource;
}
- (UITableView *)tabView{
    if (!_tabView) {
        _tabView =[UITableView zj_tableViewWithSuperview:self.view delegate:self style:UITableViewStylePlain constraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        [_tabView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    }
    return _tabView;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    GMNewsViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GMNewsViewCell" forIndexPath:indexPath];
    return cell;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}
@end
